package com.henry.feign.service;

import com.henry.pojo.Stu;
import com.henry.sentinel.fallback.FeignStuServiceFallBack;
import com.henry.vo.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @program: spring-cloud-alibaba-demo
 * @description:  伪装 stu-provider 服务的接口
 * @author: Henry.zhang
 * @create: 2022-08-31 11:06
 */


@Component
@FeignClient(
        value = "stu-provider",
        path = "stu"
//        fallback = FeignStuServiceFallBack.class
)
public interface FeignStuService {
    @GetMapping("getAll")
    public R getAll();


    @GetMapping("getOne")
    public R getOne(@RequestParam("stuId") Integer stuId);

    @GetMapping("foo")
    public R foo(@RequestParam("number") Integer number) throws Exception;

    @GetMapping("getAllList")
    public List<Stu> getAllList();
}
